From: Maxim Ermilov Date: Sat, 18 Dec 2010 19:09:58 +0000 (+0300) Subject: iconGrid: Exclude hidden children from the layout X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~9376 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=dafaab66b171dadb276928b9174e7f553cfc2f21;p=gnome-shell.git iconGrid: Exclude hidden children from the layout As all children were considered for the grid's layout, hidden items showed up as empty space. Instead, exclude hidden children from the layout, so that the grid is only made up of visible items. https://bugzilla.gnome.org/show_bug.cgi?id=631537 --- diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index ff6a60b97..e8ac3aca1 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -165,8 +165,16 @@ IconGrid.prototype = { alloc.natural_size = nColumns * this._item_size + totalSpacing; }, - _getPreferredHeight: function (grid, forWidth, alloc) { + _getVisibleChildren: function() { let children = this._grid.get_children(); + children = children.filter(function(actor) { + return actor.visible; + }); + return children; + }, + + _getPreferredHeight: function (grid, forWidth, alloc) { + let children = this._getVisibleChildren(); let [nColumns, usedWidth] = this._computeLayout(forWidth); let nRows; if (nColumns > 0) @@ -182,7 +190,7 @@ IconGrid.prototype = { }, _allocate: function (grid, box, flags) { - let children = this._grid.get_children(); + let children = this._getVisibleChildren(); let availWidth = box.x2 - box.x1; let availHeight = box.y2 - box.y1;